<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


<script type="text/javascript">
$(document).ready(function(){
    var fm = ["networkForm", "child_container", "networkFormId"];
    Page.createForm(fm);
    TempUtil.render('child_template', 'networkForm', DOC);
    Page.setStripeTable();

    function getInfo() {
        Page.postJSON({
            json: {
                cmd: RequestCmd.NETWORKSET_GET
            },
            success: function(datas) {
                 var data = datas.data;
                 $("#networkMode").val(data.act);
                 $("#networkMode").attr('old', data.act)

            }
        });
    }

    getInfo();
    
    var $btnSave = $('#btnSave');

    $btnSave.click(function() {
        $(this).attr("disabled",true);
        var $form = $('#networkForm');
        var json = JSON.parmsToJSON($form);
        
        if(json.networkMode == $("#networkMode").attr('old')){
            AlertUtil.alertMsg(CHECK.required.noChanges);
            $(this).attr("disabled",false);
            return false;
        }
        
		json.method = JSONMethod.POST;
        json.cmd = RequestCmd.NETWORKSET_SET;
        Page.postJSON({
            json: json,
            success: function(data) {
                 SysUtil.rebootDevice(PROMPT.tips.rebootMessage);
				//  $("ul.tabs a").eq(0).click();
            },
            complete: function(){
                $('#btnSave').attr("disabled",false);
                $("#networkMode").attr('old', $("#networkMode").val());
            }
        });


    })


});
</script>


<div class="tab_box" id="child_container">
    <div id="networkFormId">
        <script type="text/template" id="child_template">
            <!-- <form id="networkForm"> -->
            <table id="lockPhyCellTable" class="detail" cellspacing="0">
                <tr>
                    <th><%- lte.networkMode %><%- colon %></th>
                    <td><select id="networkMode" name="networkMode">
                        <option value="2"><%- networkMode.modePriorityVal1 %></option>
                        <option value="1"><%- networkMode.modePriorityVal1_1 %></option>
                        <option value="4"><%- networkMode.modePriorityVal2 %></option>
                        <option value="3"><%- networkMode.modePriorityVal2_1 %></option>
                        <option value="0"><%- networkMode.modePriorityVal %></option>
                    </select></td>
                </tr>
                
                <tr>
                        <th>&nbsp;</th>
                        <td><input type="button" id="btnSave" value="<%- btn.set %>" /></td>
                </tr>
            </table>         
            <!-- </form> -->
        </script>
    </div>
</div>